package com.lifang.imgsoa.util;


import lombok.Getter;
import lombok.Setter;

/**
 * 房子的照片
 * 
 * @author tom 图片类型：
 *  1, 首图
 *  3, 卧室
 *  2, 客厅
 *  4, 厨房 
 *  6, 阳台
 *  5, 卫生间
 *  7, 房型图 
 *  8, 外观图
 */
public enum HouseImageType {
	UNKNOW(1111, 0, "未知", "未知"),
	FIRSTPIC(1112, 1, "firstPic", "首图"),
	//主卧
	BEDROOM_Z(111, 3, "bedRoom", "卧室"),
	//次卧
	BEDROOM_C(112, 3, "bedRoom", "卧室"), 
	LIVINGROOM(114, 2, "livingRoom", "客厅"), 
	KITCHEN(113, 4, "kitchen", "厨房"), 
	//餐厅
	KITCHEN_C(119, 4, "kitchen", "厨房"), 
	BALCONY(1020, 6, "balcony", "阳台"), 
	WC(115, 5, "wc", "卫生间"), 
	
	HOUSETYPE(1113, 7, "houseType", "房型图"), 
	EXTERIOR(1114, 8, "exterior", "外观图");
	

	
	
	@Setter @Getter
	private int index;
	@Setter @Getter
	private int value;
	@Setter @Getter
	private String type;
	@Setter @Getter
	private String desc;

	private HouseImageType(int index, int value, String type, String desc) {
		this.index = index;
		this.value = value ;
		this.type = type;
		this.desc = desc;
	}
	
	/**
	 * 获取houseImage的value
	 * <pre>
	 *     周智明: 2015年3月26日  新建
	 * </pre>
	 *
	 * @param index
	 * @return
	 */
	public static int getTypeValue(int index) {
		for (HouseImageType c : HouseImageType.values()) {
			if (c.getIndex() == index) {
				return c.value;
			}
		}
		return 0 ;
	}
	/**
	 * 获取houseImage的type
	 * <pre>
	 *     周智明: 2015年3月26日  新建
	 * </pre>
	 *
	 * @param index
	 * @return
	 */
	public static String getTypeName(int index) {
		for (HouseImageType c : HouseImageType.values()) {
			if (c.getIndex() == index) {
				return c.type;
			}
		}
		return null ;
	}
	/**
	 * 获取houseImage的desc
	 * <pre>
	 *     周智明: 2015年3月26日  新建
	 * </pre>
	 *
	 * @param index
	 * @return
	 */
	public static String getHouseImageName(int index) {
		for (HouseImageType c : HouseImageType.values()) {
			if (c.getIndex() == index) {
				return c.desc;
			}
		}
		return null ;
	}
}